<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
</head>

<body>
<?php
/* 用户注册处理页 */
require_once("../conn/conn_db.php");   //包含数据库连接文件
if( $_POST["txt_username"]!= "" && $_POST["txt_password"]!= "" )
{
    $username = $_POST["txt_username"];  //用户名
    $password = $_POST["txt_password"];  //密码
    $email = $_POST["txt_email"];            //邮箱
    $sql = "insert into user_info (u_name,u_pwd,u_email,u_status) values('$username','$password','$email','1')";
    $insert = $conn->query($sql);         //执行SQL语句
    if($insert)
    {
        echo "<script>alert('注册成功请重新登陆！');self.location='../index.php'</script>";
    }
    else
    {
        echo "<script>alert('注册失败，请重试！');self.location='../login.php'</script>";
    }
}
else
{
    echo "<script>alert('请输入用户名和密码！');self.location='../login.php'</script>";
}
?>
	
</body>
</html>